package org.jsola.hr.service;

import org.jsola.core.Page;
import org.jsola.core.service.IService;
import org.jsola.hr.dao.ICompanyBalanceRecordDAO;
import org.jsola.hr.dto.CompanyBalanceRecordAddDTO;
import org.jsola.hr.dto.CompanyBalanceRecordUpdateDTO;
import org.jsola.hr.entity.CompanyBalanceRecordDO;
import org.jsola.hr.query.CompanyBalanceRecordQuery;
import org.jsola.hr.vo.CompanyBalanceRecordListVO;
import org.jsola.hr.vo.CompanyBalanceRecordVO;
import org.jsola.user.core.TokenUser;

import java.util.List;


/**
 * 用工单位账面余额明细表
 *
 * @author zhr
 */
public interface ICompanyBalanceRecordService extends IService<ICompanyBalanceRecordDAO, CompanyBalanceRecordDO> {

    /**
     * 新增用工单位账面余额明细表
     *
     * @param companyBalanceRecordAddDTO 新增用工单位账面余额明细表DTO
     * @param tokenUser                  当前用户
     * @return 用工单位账面余额明细表详情信息
     */
    CompanyBalanceRecordVO save(CompanyBalanceRecordAddDTO companyBalanceRecordAddDTO, TokenUser tokenUser);

    /**
     * 新增用工单位账面余额明细
     *
     * @param companyBalanceRecordDO 账面余额明细表对象
     * @param tokenUser              当前用户
     */
    void saveRecord(CompanyBalanceRecordDO companyBalanceRecordDO, TokenUser tokenUser);

    /**
     * 修改用工单位账面余额明细表
     *
     * @param companyBalanceRecordUpdateDTO 修改用工单位账面余额明细表DTO
     * @param tokenUser                     当前用户
     * @return 更新数量
     */
    int update(CompanyBalanceRecordUpdateDTO companyBalanceRecordUpdateDTO, TokenUser tokenUser);


    /**
     * 批量删除用工单位账面余额明细表，物理删除，更新is_valid字段，从回收站删除
     *
     * @param tokenUser               当前用户
     * @param companyBalanceRecordIds 用工单位账面余额明细表id
     * @return 删除数量
     */
    int deleteByIds(TokenUser tokenUser, Long... companyBalanceRecordIds);

    /**
     * 根据用工单位账面余额明细表id查找
     *
     * @param companyBalanceRecordId 用工单位账面余额明细表id
     * @param siteId                 所属站点id
     * @return 用工单位账面余额明细表详情信息
     */
    CompanyBalanceRecordVO selectById(Long companyBalanceRecordId, String siteId);

    /**
     * 查询用工单位账面余额明细表
     *
     * @param companyBalanceRecordQuery 查询条件
     * @param siteId                    所属站点id
     * @return 用工单位账面余额明细表列表信息
     */
    List<CompanyBalanceRecordListVO> select(CompanyBalanceRecordQuery companyBalanceRecordQuery, String siteId);

    /**
     * 查询用工单位账面余额明细表记录数
     *
     * @param companyBalanceRecordQuery 查询条件
     * @param siteId                    所属站点id
     * @return 用工单位账面余额明细表记录数
     */
    int selectCount(CompanyBalanceRecordQuery companyBalanceRecordQuery, String siteId);

    /**
     * 分页查询用工单位账面余额明细表
     *
     * @param companyBalanceRecordQuery 查询条件
     * @param siteId                    所属站点id
     * @return 用工单位账面余额明细表列表信息
     */
    Page<CompanyBalanceRecordListVO> selectPage(CompanyBalanceRecordQuery companyBalanceRecordQuery, String siteId);


    /**
     * 根据用工单位账面余额明细表id查找
     *
     * @param companyBalanceRecordId 用工单位账面余额明细表id
     * @param siteId                 所属站点id
     * @return 用工单位账面余额明细表
     */
    CompanyBalanceRecordDO selectDOById(Long companyBalanceRecordId, String siteId);

    /**
     * 查询用工单位账面余额明细表
     *
     * @param companyBalanceRecordQuery 查询条件
     * @param siteId                    所属站点id
     * @return 用工单位账面余额明细表列表
     */
    List<CompanyBalanceRecordDO> selectDO(CompanyBalanceRecordQuery companyBalanceRecordQuery, String siteId);

    /**
     * 分页查询用工单位账面余额明细表
     *
     * @param companyBalanceRecordQuery 查询条件
     * @param siteId                    所属站点id
     * @return 用工单位账面余额明细表列表信息
     */
    Page<CompanyBalanceRecordListVO> pageByCompanyId(CompanyBalanceRecordQuery companyBalanceRecordQuery, String siteId);

    /**
     * 查询全部用工单位账面余额明细表
     *
     * @return 用工单位账面余额明细表列表
     */
    List<CompanyBalanceRecordDO> selectAll();

    /**
     * 初始化历史数据
     *
     * @return
     */
    int init();
}


